package buildermode;

import factorymode.Zh0202AK47SubmachineGunFactory;
import factorymode.Zh0202AbstractFactory;

/**
 * @author: zh
 * @date: 2021/12/17 20:15
 * @version: 1.0
 */
public class Zh0202ConcreteBuilder extends Zh0202Builder {
    @Override
    public void buildBody() {
        player.setBody("钢铁的身体");
    }

    @Override
    public void buildCustume() {
        player.setCustume("国王的外衣");
    }

    @Override
    public void buildWeapon(int x) {
        Zh0202AbstractFactory factory;
        factory = (Zh0202AbstractFactory) XMLUtil.getBean(x);
        player.setWeapon(factory.produceWeapon());
    }

    @Override
    public Zh0202Player getResult() {
        return this.player;
    }
}
